package com.boang.lock;

/*
  @author: 13813
  @date: 2024/11/26 13:43
*/
public class TicketDemo01 extends Thread {

    private int num = 20;

    @Override
    public void run() {
        while (true) {
            //获取当前线程
//            Thread thread = Thread.currentThread();
//            String name = thread.getName();
            if (num > 0) {
                System.out.println(Thread.currentThread().getName() + ":" + num--);
            }
        }
    }
}
